function setSerachInfo(id,value){
        var info = StoreCache.getCache("searchInfo");
        if(!info){
            info={};
        }
         info[id]=value;
         StoreCache.setCache("searchInfo",info);
}
//setSerachInfo 方法写在js/common.js中
initData();
 $.pageSwitch.clickToUrl(".choose-box","common");
function initData(){
    var Info =  StoreCache.removeCache("searchInfo");
    if(Info){
        if(Info.hosName){
            $("#hosTite")[0].innerHTML=Info.hosName;
            $("#hosTite").attr("name",Info.hosCode);
            $("#hosTite").addClass("blackFont");
        }
        if(Info.userName){
            $("#cardNum")[0].innerHTML=Info.userName;
             $("#cardNum").addClass("blackFont");
        }
        if(Info.beginTime){
            $('#beginTime').val(Info.beginTime).addClass("blackFont");
        }
        if(Info.endTime){
            $('#endTime').val(Info.endTime).addClass("blackFont");
        }
    }
    $(".search").attr("onclick","search()");
}

function search(){
var obj =  StoreCache.getCache("searchInfo");
if(!obj || !obj.hosCode){
  $.QuickAlert.alertFail({
        content :"请选择医院进行查找!"
    });
}else if(!obj.userName){
     $.QuickAlert.alertFail({
        content :"请选择就诊人!"
    });
}else{
    var userInfo = JSON.parse(obj.userInfo)
    setSerachInfo("patientCardId",userInfo.sfzh);
    switch(titleType){
        case "findBills":
             $.pageSwitch.goToUrl("onlinePay","myBills");
        break;
        case "searchHosPay":
             $.pageSwitch.goToUrl("treatmentPay","zyjrResult");
        break;
        case "searchHosRecords":
            $.pageSwitch.goToUrl("hospitalRecords","hospitalListing");
        break;
        case "elePaper":
            $.pageSwitch.goToUrl("electPrescription","presListing");
        break;
        case "searchReport":
             $.pageSwitch.goToUrl("searchReport","reportList");
        break;

    }
}
}
function changeTime(id) {
    var myDate = new Date();
    var nowYear = myDate.getFullYear();
    var options = JSON.parse('{"type":"date","beginYear":1900,"endYear":2018}');
    var picker = new mui.DtPicker(options);
    picker.show(function (selectItems) {
        var value = selectItems.y.text + '-' + selectItems.m.text + '-' + selectItems.d.text;
        $('#' + id).val(value).addClass("blackFont");
        setSerachInfo(id,value);
    })
}